package com.xbsj.Client;

import com.xbsj.domain.ResultB;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

@Component
public class ClientA {
    private final RestTemplate restTemplate;

    @Value("${service.url:http://localhost:8081}")
    private String serviceUrl;

    public ClientA(RestTemplate restTemplate) {
        this.restTemplate = restTemplate;
    }

    public ResultB get(){
        return restTemplate.getForObject(serviceUrl+"/get", ResultB.class);
    }
}
